package com.neuedu.methods;

public class MethodMemmory {


    /**
     * 程序的入口
     * @param args
     */
    public static void main(String[] args) {
        int num = 100;

        System.out.println("num before = " + num); //100
        numPlus(num);
        System.out.println("num after = " + num);  //  100


        int numsArray[] = {1,2};
        System.out.println(numsArray[0] + "---"+ numsArray[1]);  //   1    ,2
        arrayPlus(numsArray);
        System.out.println(numsArray[0] + "---"+ numsArray[1]); // ??    1    2      101   102

    }


    public static  void numPlus(int num){
        num++;
        System.out.println("numPlus: "+num); // 101
    }


    /**
     * {1,2}
     * @param nums
     */
    public  static void arrayPlus(int nums[]){

        for (int i = 0; i < nums.length; i++) {
            nums[i] += 100;
        }

        // {101,102}
        System.out.println(nums[0] + "---"+ nums[1]);  // 101   102
        
    }






}
